package com.open.capacity.trade.feign.fallback;


import com.open.capacity.common.auth.details.LoginAppUser;
import com.open.capacity.common.model.Concurrent;
import com.open.capacity.common.model.Records;
import com.open.capacity.common.model.Remittance;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;
import com.open.capacity.trade.feign.TradeFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class TradeFeignClientFallbackFactory implements FallbackFactory<TradeFeignClient> {
    @Override
    public TradeFeignClient create(Throwable throwable) {
        return new TradeFeignClient() {
            @Override
            public Result insertRecords(Records records) {
                log.error("新增交易记录失败:{}", records, throwable);
                return null ;
            }

            @Override
            public Result updateRecordsAccepted(Records records) {
                return null;
            }

            @Override
            public Result updateRecordsBasic(Records records) {
                return null;
            }

//            @Override
//            public PageResult<Object> selectAllRemittanceDate() {
//                return null;
//            }

//            @Override
//            public Result updatePI(Records records) {
//                log.error("修改交易记录失败:{}", records, throwable);
//                return null;
//            }

            @Override
            public Result insertRemittance(Remittance remittance) {
                log.error("新增汇款管理失败:{}", remittance, throwable);
                return null;
            }

            @Override
            public Result updateRemittance(Remittance remittance) {
                return null;
            }
//
//            @Override
//            public PageResult<Object> selectAllConcurrentDate() {
//                return null;
//            }

            @Override
            public Result insertConcurrent(Concurrent concurrent) {
                log.error("新增兼职工资失败:{}", concurrent, throwable);
                return null;
            }

            @Override
            public Result updateConcurrent(Concurrent concurrent) {
                return null;
            }
        };
    }
}
